package ${cfg.hystrixPath};

import com.book.common.result.RestResponse;
import com.book.common.result.PageInfo;
import ${cfg.dtoPath}.${entity}Dto;
import ${cfg.voPath}.${entity}Vo;
import ${cfg.hystrixPathImpl}.${entity}HystrixImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
/**
 * Description：${table.comment!} Hystrix
 * @Author： ${author}
 * @CreateDate： ${date}
 * @Email： ${cfg.email}
 * Version: ${cfg.version}
 */
@FeignClient(value = "${cfg.applicationName}", fallbackFactory = ${entity}HystrixImpl.class)
public interface I${entity}Hystrix {
    /**
     * 根据ID获取${table.comment!}信息
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/${cfg.basePath}/${table.entityPath}/{id}", consumes = "application/json")
    RestResponse<${entity}Vo> get(@PathVariable(value = "id") String id);

    /**
     * 查询${table.comment!}信息
     *
     * @param ${table.entityPath}Dto
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/list", consumes = "application/json")
    RestResponse<List<${entity}Vo>> list(@RequestBody ${entity}Dto ${table.entityPath}Dto);

    /**
     * 查询${table.comment!}信息
     *
     * @param ${table.entityPath}Dto
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/page/list", consumes = "application/json")
    RestResponse<PageInfo<${entity}Vo>> pageList(@RequestBody ${entity}Dto ${table.entityPath}Dto);

    /**
     * 新增${table.comment!}信息
     *
     * @param ${table.entityPath}Dto
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/save", consumes = "application/json")
    RestResponse<String> save(@RequestBody ${entity}Dto ${table.entityPath}Dto);

    /**
     * 修改${table.comment!}信息
     *
     * @param ${table.entityPath}Dto
     * @return
     */
    @PutMapping(value = "/${cfg.basePath}/${table.entityPath}/update", consumes = "application/json")
    RestResponse<String> update(@RequestBody ${entity}Dto ${table.entityPath}Dto);

    /**
     * 删除${table.comment!}信息
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/${cfg.basePath}/${table.entityPath}/delete/{id}", consumes = "application/json")
    RestResponse<String> delete(@PathVariable(value = "id") String id);

    /**
     * 导出${table.comment!}模板信息
     *
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/export/template", consumes = "application/json")
    RestResponse<String> exportTemplate();

    /**
     * 导出${table.comment!}信息
     *
     * @param ${table.entityPath}Dto
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/export/excel", consumes = "application/json")
    RestResponse<String> exportExcel(@RequestBody ${entity}Dto ${table.entityPath}Dto);

    /**
     * 导入${table.comment!}信息
     *
     * @param filePath
     * @return
     */
    @PostMapping(value = "/${cfg.basePath}/${table.entityPath}/import/excel", consumes = "application/json")
    RestResponse<String> importExcel(@RequestParam(value = "filePath") String filePath);

}
